package com.woniuxy.service.daily.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniuxy.dao.CheckrecordMapper;
import com.woniuxy.pojo.Checkrecord;
import com.woniuxy.pojo.Driver;
import com.woniuxy.service.daily.CheckrecordService;

@Service
public class CheckrecordServiceImpl implements CheckrecordService{
	
	@Autowired
	CheckrecordMapper checkrecordMapper;

	@Override
	public List<Checkrecord> getAllList() {
		// TODO Auto-generated method stub
		List<Checkrecord> checklist=checkrecordMapper.GetAllList();
		return checklist;
	}

	@Override
	public Checkrecord selectById(Integer cid) {
		// TODO Auto-generated method stub
		
		return checkrecordMapper.selectByPrimaryKey(cid);
	}

	@Override
	public void addCheck(Checkrecord check) {
		// TODO Auto-generated method stub
		
		checkrecordMapper.insertSelective(check);
	}

	@Override
	public void deleteById(Integer cid) {
		// TODO Auto-generated method stub
		checkrecordMapper.deleteByPrimaryKey(cid);
	}

	@Override
	public int deleteChecks(Integer[] CheckId) {
		// TODO Auto-generated method stub
		return checkrecordMapper.deletChecks(CheckId);
		
	}

	@Override
	public void updateByPrimaryKeySelective(Checkrecord cr) {
		// TODO Auto-generated method stub
		checkrecordMapper.updateByPrimaryKeySelective(cr);
	}

	@Override
	public Checkrecord selectCheckById(Integer cid) {
		// TODO Auto-generated method stub
		
		return checkrecordMapper.selectById(cid);
	}

	@Override
	public List<Checkrecord> selectByCondition(String condition) {
		// TODO Auto-generated method stub
		return checkrecordMapper.selectByCondition(condition);
		
	}

	@Override
	public PageInfo selectByConditions(Integer pn, String conditions) {
		// TODO Auto-generated method stub
		PageHelper.startPage(pn, 5);
		List<Checkrecord> list=checkrecordMapper.selectByCondition(conditions);
		PageInfo pageInfo=new PageInfo(list, 2);
		return pageInfo;
	}



}
